$contents = [string]::Join("`n",(Get-Content RGP.txt))
$index = 0;
$regex = [regex]'Psalm\s*(\d+)\s+([^`]+?)(?=\s+Psalm|$)';
$match = $regex.match($contents);
while($match.Success) {
    $text = $match.Groups[2].Value;
    $num = $match.Groups[1].Value;
    echo $num;
    $text | out-file "$num.txt" -Encoding UTF8
    $match = $regex.match($contents,$match.Index + $match.Length);
}